version: '2'

services:

  postgres:
    image: postgres
    container_name: db_rentauto
    environment:
      POSTGRES_DB: rent_auto_v2
      POSTGRES_PASSWORD: qazwsx

  backend:
    build: ./Backend
    container_name: back-end
    depends_on:
      - postgres
    environment:
      - SPRING_DATASOURCE_URL=jdbc:postgresql://postgres:5432/rent_auto_v2
      - SPRING_DATASOURCE_USERNAME=postgres
      - SPRING_DATASOURCE_PASSWORD=qazwsx
    ports:
      - 8088:8088

  frontend:
    build: ./Frontend
    container_name: front-end
    depends_on:
      - backend
    volumes:
      - ./Frontend:/app
    ports:
      - 3000:3000

  adminer:
    image: adminer
    ports:
      - 8080:8080
    depends_on:
      - postgres